<template>
  <div class="header">
    <span class="sys-name">
      <router-link :to="{ name: 'ClubIndex' }">返回首页</router-link>
    </span>
    <div class="right-menue" style="”clear: both”">
      <el-avatar :src="this.photo"></el-avatar>
      <span class="name">{{ this.username }}，你好</span>

      <span @click="logout" class="logout">退出登录</span>
    </div>
    <div style="”clear: both”"></div>
  </div>
</template>

<script>
import router from '@/router'
import decodedToken from '@/api/tokenDecode'

export default {
  data() {
    return {
      username: decodedToken().claims.username,
      photo: decodedToken().claims.photo,
    }
  },
  methods: {
    logout() {
      localStorage.clear()
      router.push('/login')
    },
  },
}
</script>

<style scoped="scoped">
.header {
  position: fixed;
  top: 0;
  left: 200px;
  right: 0;
  height: 60px;
  background-color: #cad7e7;
}
.header .sys-name {
  display: block;
  height: 60px;
  width: 250px;

  line-height: 60px;
  margin-left: 20px;
  color: black;
}
.header .sys-name a {
  color: black;
  text-decoration: none;
  font-size: 16px;
}
.right-menue {
  width: 300px;
  height: 55px;
  line-height: 60px;
  margin-top: -60px;
  float: right;
  color: black;
  /* background-color: #13CE66; */
}
.logout {
  cursor: pointer;
  margin-left: 30px;
}
</style>
